package model;

public class Alive extends State {

	@Override
	public boolean isAlive() {
		return true;
	}

	@Override
	public State nextStateFor(Cell cell) {
		int aliveNeigbours = countAmountAliveNeighbours(cell);
		State state = this;
		if ( aliveNeigbours < 2 || aliveNeigbours > 3){
			state = new Dead();
		}
		return state;
	}

}
